package com.hl.sfzy.controller.myController;

import com.hl.sfzy.entity.my.MyAssessment;
import com.hl.sfzy.service.myService.MyAssessmentService;
import com.hl.sfzy.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/my/assessment")
public class MyAssessmentController {
    @Autowired
    private MyAssessmentService myAssessmentService;

    @GetMapping("/getAssessment")
    public R assessment(int userId,int pageNo,int pageSize){
        List<MyAssessment> assessments = myAssessmentService.myAssessmentList(userId,pageNo,pageSize);
        if (assessments != null){
            return R.success(assessments);
        }else {
            return R.failure("查询失败");
        }
    }
}
